package demo2;

public class LeetCode0101 {
    public boolean isUnique(String astr) {
        if (astr.length() > 26) return false;
        int n = 0;
        for (int i = 0; i < astr.length(); i++) {
            int x = astr.charAt(i) - 'a';
            if (((n >> x) & 1) == 1) return false;
            n |= 1 << x;
        }
        return true;
    }
}
